<template>
  <div class="announcement-board">
    <!-- 公告标题 -->
    <div class="board-header">
      <h2><i class="el-icon-megaphone"></i> 系统公告</h2>
    </div>
    
    <!-- 公告列表 -->
    <div class="announcement-list">
      <el-timeline>
        <el-timeline-item
          v-for="(announcement, index) in announcements"
          :key="index"
          :timestamp="announcement.date"
          placement="top"
        >
          <el-card shadow="hover" class="announcement-card">
            <h3>{{ announcement.title }}</h3>
            <div class="announcement-content">
              <p>{{ announcement.content }}</p>
            </div>
            <div class="announcement-footer">
              <span class="publisher">{{ announcement.publisher }}</span>
            </div>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AnnouncementBoard',
  data() {
    return {
      announcements: [
        {
          title: '系统维护通知',
          date: '2023-05-15',
          content: '为了提供更好的服务，我们计划于2023年5月20日00:00至06:00进行系统维护。在此期间系统将无法访问，请提前做好相关工作安排。',
          publisher: '系统管理员'
        },
        {
          title: '新版功能上线',
          date: '2023-04-28',
          content: '本次更新新增了数据导出功能，优化了用户界面体验，修复了已知的若干问题。欢迎体验并提出宝贵意见。',
          publisher: '产品团队'
        },
        {
          title: '五一假期安排',
          date: '2023-04-25',
          content: '根据国家法定节假日安排，2023年五一假期为4月29日至5月3日。假期期间客服服务时间调整为9:00-18:00。',
          publisher: '客服中心'
        },
        {
          title: '系统使用培训通知',
          date: '2023-04-10',
          content: '将于2023年4月15日下午14:00在会议室A举办系统使用培训，请各部门派代表参加。',
          publisher: '人力资源部'
        }
      ]
    };
  }
};
</script>

<style scoped>
.announcement-board {
  max-width: 800px;
  margin-top: 20px;
  margin-bottom: 40px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.board-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.board-header h2 {
  color: #333;
  font-size: 24px;
}

.board-header i {
  margin-right: 10px;
  color: #409EFF;
}

.announcement-list {
  padding: 0 20px;
}

.announcement-card {
  margin-bottom: 20px;
  transition: all 0.3s;
}

.announcement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15);
}

.announcement-card h3 {
  color: #409EFF;
  margin-bottom: 15px;
  font-size: 18px;
}

.announcement-content {
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.announcement-footer {
  text-align: right;
  font-size: 12px;
  color: #999;
}

.publisher {
  padding-left: 20px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>') no-repeat left center;
  background-size: 16px;
}

@media (max-width: 768px) {
  .announcement-board {
    padding: 15px;
  }
  
  .board-header h2 {
    font-size: 20px;
  }
  
  .announcement-list {
    padding: 0;
  }
}
</style>